home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000065_icon-group-sender_Fri Mar 28 12:34:33 2003.msg < prev    next >
Internet Message Format  |  2003-12-22  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2SJYIQ24540
  4.     for icon-group-addresses; Fri, 28 Mar 2003 12:34:18 -0700 (MST)
  5. Message-Id: <200303281934.h2SJYIQ24540@baskerville.CS.Arizona.EDU>
  6. From: voice_of_reason@australia.edu (Quiet Voice)
  7. X-Newsgroups: comp.lang.icon
  8. Subject: Re: Befuddled by logic and an error message.....
  9. Date: 28 Mar 2003 07:46:07 -0800
  10. X-Complaints-To: groups-abuse@google.com
  11. To: icon-group@cs.arizona.edu
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14.  
  15. A follow-up to my own post based on some e:mail I recieved....
  16.  
  17. >Are you running on Windows or UNIX...on NT4SP6a with
  18. >Icon 9.3.2 I get this:
  19. >
  20. >Run-time error 214
  21. >File io.icn; Line 4
  22. >input/output error
  23. >offending value: 68
  24. >Traceback:
  25. >   main()
  26. >   write(file(x),68) from line 4 in io.icn
  27. >
  28.  
  29. I am running under Win 2000 with version 9.3.2.....and that is
  30. precisely the error message I get.
  31.  
  32. >
  33. >But I've got a broader question: Why is the temp file necessary?  
  34.  
  35. I use the temp file because the editting process is iterative. 
  36.  
  37. What I mean is that the program reads in the original file, writes it
  38. over to a temporary holding file and offers the user a chance to edit
  39. the file, observe the results and re-edit...over and over...until he
  40. is satisfied. Each time, the program outputs the original file along
  41. side the most recent edits.
  42.  
  43. Once satisfied, the program writes out the final version of the temp
  44. file as the "answer".
  45.  
  46.  
  47.  
  48. voice_of_reason@australia.edu (Quiet Voice) wrote in message news:<9428c6a7.0303271418.6dd64a38@posting.google.com>...
  49. > Greetings:
  50. > Still in my endeavor to "re-learn" ICON, I have hit upon a bug that is
  51. > partially a logic bug and partially a runtime error.
  52. > What I am attempting to do is as follows --
  53. > A file is opened which contains text.
  54. > The idea of the program is to allow the user to selectively and
  55. > iteratively edit and re-edit the file and see the edits alongside the
  56. > original version of text.
  57. > The program creates and output file that holds the original text and
  58. > the current state of editing.
  59. > A line from the original file along with the corresponding edited line
  60. > are written to output.
  61. > With each pass thru the loop the idea is that the program opens a temp
  62. > file that holds the current editing. The user is essentially
  63. > iteratively editing the temp file.
  64. > Here's the code fragment along with comments I've written to
  65. > myself....
  66. > target := current text
  67. > edit := proposed edits
  68. >   .
  69. >   .
  70. >   .
  71. > # LOGIC PROBLEM WITH THIS LOOP. NEED TO READ DATA FROM CURRENT GUESS
  72. > *THEN* SAVE NEW GUESS FOR
  73. > # FUTURE READ....but NEED TO PREVENT "INFINTIE LOOP" SITUATION OF
  74. > READING THEN WRITING THEN READING>>>>ETC
  75. > # CURRENT VERSION RESULTS IN RUN-TIME ERROR: 214 (???) in line 88
  76. > while (line := read(temp_holder)) do
  77. >               {
  78. >            orig := read(orig_text)
  79. >                trial_line := map(line,target,edit)
  80. >                write(output,"original: ",orig)
  81. >                write(output," ")
  82. >                write(output,"new:      ",trial_line)
  83. >                write(output," ")
  84. > OFFENDING LINE OF CODE  ==> write(temp_holder,trial_line)   # save
  85. > current trial set
  86. >                 }
  87. > write("TRIAL CORRECTIONS WRITTEN TO TEMPORARY FILE.")
  88. > writes("Do you have more corrections? Type yes or no: ")
  89. > more := read()
  90. > } #end INPUT loop
  91. > ---
  92. > First of all, what sort of situations create a runtime error 214? What
  93. > am I doing wrong?
  94. > Secondly, any suggestions on how better to accomplish this?
  95. > Thanks for the advice and assitance.....
  96.